{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post" enctype="">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">文章标题</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入名称" lay-verify="required|name" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">缩略图</label>
                    <div class="layui-input-inline">
                        <img class="layui-upload-img" id="test-upload-normal-img" src="{$data.img|default='__AD_IMG__/upload.png'}" width="50" height="50">
                        <input type="hidden" name="img" value="{$data.img|default=''}" autocomplete="off" placeholder="" class="layui-input">
                        <button type="button" class="layui-btn ajax-avatar"><i class="fa fa-file-image-o"></i> 上传缩略图</button>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">阅读量</label>
                    <div class="layui-input-inline">
                        <input type="text" name="reading" value="{$data.reading|default=''}" autocomplete="off" placeholder="请输入虚拟阅读量" lay-verify="" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sort" value="{$data.sort|default=''}" autocomplete="off" placeholder="请输入排序编号" lay-verify="" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <div class="layui-inline">
                    <label class="layui-form-label">简短描述</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" name="article_brief" class="layui-textarea">{$data.article_brief|default=''}</textarea>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文章内容</label>
                <div class="layui-input-block">
                    <textarea name="content" placeholder="请输入详情内容" id="editor" style="height:400px;">{$data.content|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
{block name="js"}
{js href="__AD_LIBS__/ueditor/ueditor.config.js,__AD_LIBS__/ueditor/ueditor.all.min.js,__AD_LIBS__/ueditor/lang/zh-cn/zh-cn.js" /}
<script>
    UE.getEditor('editor',{
        initialFrameWidth :'auto',// 设置编辑器宽度
        initialFrameHeight:400,// 设置编辑器高度
        scaleEnabled:true
    });
</script>
{/block}